if (contentDocument && contentDocument.documentElement && contentDocument.documentElement.nodeName && contentDocument.documentElement.nodeName.toLowerCase() == "svg") {

                   var width = undefined;
                   var height = undefined;

                   var wAttr = contentDocument.documentElement.getAttribute("width");
                   var isWidthPercent = wAttr && wAttr.length >= 1 && wAttr[wAttr.length - 1] == '%';
                   if (wAttr) {
                       try {
                           width = parseInt(wAttr, 10);
                       }
                       catch (err) {}
                   }
                   if (width && isWidthPercent) {
                       widthPercent = width;
                       width = undefined;
                   }

                   var hAttr = contentDocument.documentElement.getAttribute("height");
                   var isHeightPercent = hAttr && hAttr.length >= 1 && hAttr[hAttr.length - 1] == '%';
                   if (hAttr) {
                       try {
                           height = parseInt(hAttr, 10);
                       }
                       catch (err) {}
                   }
                   if (height && isHeightPercent) {
                       heightPercent = height;
                       height = undefined;
                   }

                   if (width && height) {
                        size = {
                            width: width,
                            height: height
                        }
                   }
                }